import React, { useState, useEffect } from 'react'
import { GlobalVal } from '../../global'
import Draggable from 'react-draggable';

// 拖拽组件
export default (props) => {
    return (
        <Draggable
            axis="both"
            handle=".handle"
            defaultPosition={{ x: 0, y: 0 }}
            position={null}
            grid={[25, 25]}
            scale={1}
        //   onStart={this.handleStart}
        //   onDrag={this.handleDrag}
        //   onStop={this.handleStop}
        >
            <div className="App" style={{ ...GlobalVal.toolbar,...props.style }}>
                <div className="handle"></div>
                {props.children}
            </div>
        </Draggable>

    )
}

